package com.wanxi.test;

public class TimesString {
    public static void main(String[] args) {
        /**
         * 1.用户输入字符串
         * 2.得到字符串，
         * 3.计算每一个字符串的出现的次数(大写，小写，数字)
         *      怎么判断它是属于大写，小写，数字？
         *      ascii码
         *
         */
        Tool tool = new Tool();
        String str = tool.scanner("请输入一段字符串");
        int numTime = 0;
        int bigTime = 0;
        int smallTime = 0;
        for (int i = 0; i < str.length(); i++) {
//            char int;
            int as = str.charAt(i);
            if (as >= 48 && as <= 57) {
                numTime++;
            }
            if (as >= 65 && as <= 90) {
                bigTime++;
            }
            if (as >= 97 && as <= 122) {
                smallTime++;
            }

        }
        System.out.println("数字：" + numTime);
        System.out.println("大写：" + bigTime);
        System.out.println("小写：" + smallTime);

    }
}
